<%@page import="com.project.model.Jobs"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.project.db.SQLHelper"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	Cookie[] cookie = request.getCookies();
	for (Cookie c : cookie) {
		if (c.getName().equals("userid_admin")) {
			String id = c.getValue();
		}
	}
	ArrayList<Jobs> jobs = new ArrayList<Jobs>();
	jobs = SQLHelper.getJobs();
%>
<html lang="zh-cn">
<head>
<meta charset="utf-8" />
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="css/app-resume.css" rel="stylesheet">
</head>
<body>
	<nav>
	<div style="width: 100%; height: 5px; background-color: #444;"></div>
	<div class="container">
		<div class="tran">My Resume</div>
		<ul>
			<li><p>Admin，你好。</p></li>
			<li><a href="/indexadmin.jsp">退出</a></li>
		</ul>
	</div>
	</nav>
	<div class="container" style="margin-top: 50px;">
		<h3 style="line-height: 35px; font-size: 16px; font-weight: bold;">>新投递简历/New
			Resume</h3>
		<div class="item">
			<table>
				<thead>
					<tr style="background-color: #F8F8F8;">
						<th>投递人姓名
							<p>Resume Type</p>
						</th>
						<th>简历类型
							<p>Resume Type</p>
						</th>
						<th>投递时间
							<p>Date of Creation</p>
						</th>
						<th>投递岗位
							<p>His Job</p>
						</th>
						<th>状态
							<p>State</p>
						</th>
						<th>操作
							<p>Modify</p>
						</th>
					</tr>
				</thead>
				<%
					for (int i = 0; i < jobs.size(); i++) {
						if (jobs.get(i).getState() == 0) {
				%>
				<tr>
					<td><a
						href="/resumeinfo.jsp?userid=<%=jobs.get(i).getUserid()%>"><%=SQLHelper.getName(String.valueOf(jobs.get(i)
							.getUserid()))%></a></td>
					<td>校招简历
						<p>Campus Recruitment</p>
					</td>
					<td><%=jobs.get(i).getDate()%></td>
					<td><%=jobs.get(i).getJobs()%></td>
					<td>未开始流程</td>
					<td><a
						href="/passJobAction?id=<%=jobs.get(i).getId()%>">安排一面</a><a
						href="/resuseJobAction?id=<%=jobs.get(i).getId()%>">回绝</a></td>
				</tr>
				<%
					}
					}
				%>
				</tbody>
			</table>
		</div>
	</div>
	<!--待处理简历-->
	<div class="container" style="margin-top: 50px;">
		<h3 style="line-height: 35px; font-size: 16px; font-weight: bold;">>待处理简历/Ing
			Resume</h3>
		<div class="item">
			<table>
				<thead>
					<tr style="background-color: #F8F8F8;">
						<th>投递人姓名
							<p>Resume Type</p>
						</th>
						<th>简历类型
							<p>Resume Type</p>
						</th>
						<th>投递时间
							<p>Date of Creation</p>
						</th>
						<th>投递岗位
							<p>His Job</p>
						</th>
						<th>状态
							<p>State</p>
						</th>
						<th>操作
							<p>Modify</p>
						</th>
					</tr>
				</thead>
				<tbody>
					<%
						for (int i = 0; i < jobs.size(); i++) {
							if (jobs.get(i).getState() == 1 || jobs.get(i).getState() == 2) {
								String strState = "";
								String strTemp = "";
								if (jobs.get(i).getState() == 1) {
									strState = "一面中";
									strTemp = "一面通过";
								} else if (jobs.get(i).getState() == 2) {
									strState = "二面中";
									strTemp = "二面通过";
								}
					%>
					<tr>
						<td><a
							href="/resumeinfo.jsp?userid=<%=jobs.get(i).getUserid()%>"><%=SQLHelper.getName(String.valueOf(jobs.get(i)
							.getUserid()))%></a></td>
						<td>校招简历
							<p>Campus Recruitment</p>
						</td>
						<td><%=jobs.get(i).getDate()%></td>
						<td><%=jobs.get(i).getJobs()%></td>
						<td><%=strState%></td>
						<td><a
							href="/passJobAction?id=<%=jobs.get(i).getId()%>"><%=strTemp%></a><a
							href="/resuseJobAction?id=<%=jobs.get(i).getId()%>">回绝</a></td>
					</tr>
					<%
						}
						}
					%>

				</tbody>
			</table>
		</div>
	</div>
	<!--已结束简历-->
	<div class="container" style="margin-top: 50px;">
		<h3 style="line-height: 35px; font-size: 16px; font-weight: bold;">>已结束简历/Past
			Resume</h3>
		<div class="item">
			<table>
				<thead>
					<tr style="background-color: #F8F8F8;">
						<th>投递人姓名
							<p>Resume Type</p>
						</th>
						<th>简历类型
							<p>Resume Type</p>
						</th>
						<th>投递时间
							<p>Date of Creation</p>
						</th>
						<th>投递岗位
							<p>His Job</p>
						</th>
						<th>状态
							<p>State</p>
						</th>
						<th>操作
							<p>Modify</p>
						</th>
					</tr>
				</thead>
				<tbody>
					<%
						for (int i = 0; i < jobs.size(); i++) {
							if (jobs.get(i).getState() == 3 || jobs.get(i).getState() == 4) {
								String strState = "";
								if (jobs.get(i).getState() == 3) {
									strState = "已录用";
								} else if (jobs.get(i).getState() == 4) {
									strState = "已回绝";
								}
					%>
					<tr>
					<tr>
						<td><a
							href="/resumeinfo.jsp?userid=<%=jobs.get(i).getUserid()%>"><%=SQLHelper.getName(String.valueOf(jobs.get(i)
							.getUserid()))%></a></td>
						<td>校招简历
							<p>Campus Recruitment</p>
						</td>
						<td><%=jobs.get(i).getDate()%></td>
						<td><%=jobs.get(i).getJobs()%></td>
						<td><%=strState%></td>
						<td><a
							href="/deleteJobAction?id=<%=jobs.get(i).getId()%>">删除</a></td>
					</tr>

					<%
						}
						}
					%>


				</tbody>
			</table>
		</div>
	</div>
</body>
</html>